import Vue from "vue"
import VueRouter from "vue-router"
// import HomeView from '../views/HomeView.vue'
import IndexVue from "../views/index.vue"

Vue.use(VueRouter)

const routes = [
  {
      path: "/",  // 默认在首页
      name: 'index',
      component: IndexVue,    // 首页必须这样导入
  },
//   {
//     path: "/",  // 重定向到首页  path:'/', 不用换  只改变redirect:'/xxx' 
//     redirect:'/index'
// },

// 大触详情页如下
  {
    path: '/DachuLiveInfo/:id',   // 大触直播详情页
    name: 'DachuLiveInfo',
    component: () => import(/* webpackChunkName: "about" */ '../views/DachuLiveInfo.vue')
  },
  {
    path: '/DachuTwoInfo/:id',   // 大触专访详情页
    name: 'DachuTwoInfo',
    component: () => import(/* webpackChunkName: "about" */ '../views/DachuTwoInfo.vue')
  },


  {
    path: '/DachuTwoInfo',   // 大触专访详情页
    name: 'DachuTwoInfo',
    component: () => import(/* webpackChunkName: "about" */ '../views/DachuTwoInfo.vue')
  },
  {
    path: '/DachuThreeInfo',   // 大触周边详情页
    name: 'DachuThreeInfo',
    component: () => import(/* webpackChunkName: "about" */ '../views/DachuThreeInfo.vue')
  },

  {
    path: '/course',
    name: 'course',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/course.vue')
  },
  {
    path: '/school',
    name: 'school',
    component: () => import(/* webpackChunkName: "about" */ '../views/school.vue')
  },
  {
    path: '/dachu',
    name: 'dachu',
    component: () => import(/* webpackChunkName: "about" */ '../views/dachu.vue')
  },
  {
    path: '/community',
    // name: 'community',  //
    component: () => import(/* webpackChunkName: "about" */ '../views/community.vue'),
    children:[
      {
        path: '',
        name: 'communityTask',
        component: () => import(/* webpackChunkName: "about" */ '../views/communityTask.vue'),
      },
      {
        path: 'communityAnswer',
        name: 'communityAnswer',
        component: () => import(/* webpackChunkName: "about" */ '../views/communityAnswer.vue'),
      },
      {
        path: 'communityWorks',
        name: 'communityWorks',
        component: () => import(/* webpackChunkName: "about" */ '../views/communityWorks.vue'),
      },
      {
        path: 'communityDraw',
        name: 'communityDraw',
        component: () => import(/* webpackChunkName: "about" */ '../views/communityDraw.vue'),
      },
    ]
  },

  // {
  //   path: '/',
  //   name: 'home',
  //   component: HomeView
  // },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // },
]

const router = new VueRouter({
  routes
})

export default router
